package com.coder4j.platform.mapper;

import com.coder4j.starter.mybatis.BaseMapper;
import com.coder4j.platform.entity.BizRefEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.Arrays;
import java.util.List;

/**
 * 关系表
 * @author keller
 * @date 2024-12-05 10:46:31
 */
@Mapper
public interface BizRefMapper extends BaseMapper<BizRefEntity>{
	/**
     * 默认查询条件
     * @return
     */
    @Override
    default List<String> defaultCondition(){
    return Arrays.asList(
			" <if test = 'type!=null'> AND type=#{type} </if>",
			" <if test = 'sourceId!=null'> AND source_id=#{sourceId} </if>",
			" <if test = 'targetId!=null'> AND target_id=#{targetId} </if>",
            " <if test = 'createId!=null'> AND create_id=#{createId} </if>",
            " <if test = 'updateId!=null'> AND update_id=#{updateId} </if>");
    }
}
